//
//  ViewController.m
//  弹出蒙层
//
//  Created by Hello Cai on 2019/6/3.
//  Copyright © 2019 Hello Cai. All rights reserved.
//

#import "ViewController.h"
#import "PopViewController.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (IBAction)gotoAction:(UIButton *)sender {
    
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    PopViewController *vc = [sb instantiateViewControllerWithIdentifier:@"PopViewController"];
//    vc.definesPresentationContext = YES;
//    vc.providesPresentationContextTransitionStyle = YES;
    //关于modalPresentationStyle的用法请按option查阅开发文档
    //使用UIModalPresentationOverCurrentContext和UIModalPresentationCustom，当presentation完成时，present前的控制器view不会从视图层级结构中移除
    vc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
    [self presentViewController:vc animated:NO completion:nil];
//    [self presentViewController:vc animated:YES completion:nil];
}

@end
